package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.junsi.bean.Salestage;
import com.junsi.mapper.SalestageMapper;
import com.junsi.service.SalestageService;

@Service
@Transactional(rollbackFor = Exception.class)
public class SalestageServiceImpl implements SalestageService{
  
	@Autowired
	private SalestageMapper salestageMapper;
	
	@Override
	public List<Salestage> listAll() {
		List<Salestage> lsit=salestageMapper.listAll();
		return lsit;
	}

	@Override
	public Salestage findById(Integer id) {
		Salestage record=salestageMapper.findById(id);
		return record;
	}

	@Override
	public boolean insert(Salestage o) throws Exception {

		int result = salestageMapper.insert(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean update(Salestage o) throws Exception {

		int result = salestageMapper.update(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean delete(Integer id) {

		int result = salestageMapper.delete(id);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

}
